package ar.com.sebasoft.rembrandt.util;

import java.io.File;
import java.util.Locale;

import ar.com.sebasoft.rembrandt.R;

/**
 * @author SebaSOFT
 * 
 */
public class StringUtil {
	public static String getAlbumPath(String path) {
		String res = "";

		String[] partes = path.split(Character.toString(File.separatorChar));
		int count = partes.length;
		for (int i = 0; i < (partes.length - 1); i++) {
			res += partes[i] + File.separatorChar;
		}
		return res;
	}

	public static String getAlbumName(String path) {
		String res = SystemHelper.getLocalizedString(R.string.msg_no_name);

		String[] partes = path.split(Character.toString(File.separatorChar));
		int count = partes.length;
		if ((partes != null) && (count > 1)) {
			res = partes[count - 2];
			res = res.toLowerCase(Locale.US);
		}
		return res;
	}
}
